/**
 * vue程序执行的入口(打包的入口)
 */
// 导入Vue
import Vue from 'vue'
// 导入一个页面
// import App from './App.vue'
// import App from './views/day_01/基础用法.vue'
// import App from './views/day_01/属性动态绑定.vue'
// import App from './views/day_01/事件绑定.vue'
// import App from './views/day_01/事件修饰符.vue'
// import App from './views/案例/反转世界.vue'
// import App from './views/day_01/v-for用法.vue'
// import App from './views/day_01/作业/帅哥美女走一走.vue'
// import App from './views/day_01/作业/加加减减.vue'
// import App from './views/day_01/作业/购物车.vue'
// import App from './views/day_01/双向绑定.vue'
// import App from './views/案例/折叠面板.vue'
// import App from './views/day_02/v-for使用注意.vue'
// import App from './views/day_02/动态样式.vue'
// import App from './views/案例/品牌管理(铺增删).vue'
// import App from './views/day_02/filters过滤器.vue'
// import App from './views/day_02/computed计算属性.vue'
import App from './views/day_02/计算属性缓存.vue'
// import App from './views/案例/全选.vue'
// import App from './views/day_02/作业/买点书.vue'
// import App from './views/day_02/作业/选中元素求和.vue'
// import App from './views/day_02/watch监听属性'
// import App from '@/views/day_03/组件化演示.vue'
// import App from '@/views/day_03/样式模块化.vue'
// import App from '@/views/day_03/组件通信.vue'
// import App from './views/day_03/作业/狗子.vue'
// import App from './views/day_03/作业/狗子2.vue'
// import App from './views/day_03/作业/狗子3.vue'
// import App from './views/day_04/axios图书查询.vue'
// import App from './views/day_04/$refs使用.vue'
// import App from './views/day_04/$nextTick.vue'
// import App from './views/day_04/$nextTick使用场景.vue'
// import App from './views/day_05/动态组件.vue'
// import App from './views/day_05/插槽的使用.vue'
// import App from './views/day_05/作用域插槽使用场景.vue'
// import App from './views/day_05/自定义指令.vue'
// import App from './views/爷孙传值(不使用$emit)练习/爷组件.vue'


// 导入全局注册的页面下的组件
// @/指代src/
import Panel from '@/components/panel.vue'

// 生产环境提示关闭
Vue.config.productionTip = false

// 定义全局过滤器->所有的.vue文件都可以访问使用
Vue.filter('add', (value) => {
  // add是过滤器的名字，value是被过滤的值
  // console.log(value);
  return value + 456
})

// 注册全局组件=>Vue.component('组件标签名', 组件对象)
Vue.component('Panel', Panel)

import axios from 'axios'
axios.defaults.baseURL = 'http://123.57.109.30:3006'

// 定义全局自定义指令
// 语法：Vue.directive(指令的名字(v-后面的那部分), 对象(写逻辑))
Vue.directive('focus', {
  // 当被绑定的元素插入到DOM中时执行
  inserted(el) {
    // 操作DOM
    console.log('使用指令的元素', el);
    el.focus();
  }
})

new Vue({
  // 渲染.vue页面，
  render: h => {
    console.log(h); // 查看h函数
    return h(App)
  },
}).$mount('#app')  // 渲染到public中的index.html页面中id为app的元素中
